/*
 *  GDT.h
 *  xD-OS
 *
 *  Created by James Johns on 22/07/2009.
 *  Copyright 2009 xD-Dunce. All rights reserved.
 *
 */

#include "global.h"

#ifndef GDT_H
#define GDT_H

struct gdt_entry {
	Word limitLow;
	Word baseLow;
	Byte baseMid;
	Byte flags;
	Byte limitMid;
	Byte baseHigh;
} __attribute__((packed));

struct gdt_descriptor {
	Word size;
	dWord address;
}__attribute__((packed));


struct gdt_descriptor gdtDescriptor;
struct gdt_entry gdt[5];

extern void loadGDT(dWord address);

void initGDT();
void insertGDTEntry(dWord entryNum, dWord base, dWord limit, Word flags);



#endif
